package com.lcu.student.mapper;

import com.lcu.student.entity.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {
    //新增用户
    @Insert("insert into user(user_name,user_password) values(#{userName},#{userPassword})")
    public int adduser(@Param("userName") String userName,@Param("userPassword") String userPassword);

    //根据用户名判断密码是否正确
    @Select("select * from user where user_name=#{userName}")
    public User get(String userName);

    //根据用户名查出用户信息
    @Select("select * from user where user_name=#{userName}")
    public User selectUser(String userName);

    //根据用户Id修改密码
    @Update("update user set user_password=#{password} where user_id=#{id}")
    public void updateById(@Param("id") int id,@Param("password") String password);

}
